package controller;

import enity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/*@Scope("singleton")//通过字符串*/
/*@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)//通过枚举值*/
@Controller
public class UserController {
    @Autowired
    public User user;
    public void setUser() {
        user.setAge(18);
        user.setId(1);
        user.setName("张三");
        System.out.println(user);
    }
}
